package itxinhaimijijia.hierarchicaldecoupling.dao.Impl;

import cn.hutool.core.io.IoUtil;
import itxinhaimijijia.hierarchicaldecoupling.dao.HeroDao;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

public class HeroDaoImpl implements HeroDao {
    @Override
    public List<String> findAll() {
//        return List.of();
        InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("hero.txt");
        ArrayList<String> lines = IoUtil.readLines(resourceAsStream, StandardCharsets.UTF_8, new ArrayList<>());

        return lines;
    }
}
